package com.ecoolex.ying.space.enums;

import com.ecoolex.framework.common.EnumInterface;
import com.ecoolex.framework.common.util.Check;

public enum PaymentOrderStatus implements EnumInterface<PaymentOrderStatus, Integer> {
	PAY_APPLY(1, "发起支付"),
	PAY_SUCCEED(2, "支付成功"),
	PAY_FAILED(3, "支付失败"),
	REFUND_APPLY(11, "发起退款"),
	REFUND_SUCCEED(12, "退款成功"),
	REFUND_FAILED(13, "退款失败");

	private int real;

	private String describe;

	private PaymentOrderStatus(int real, String describe) {
		this.real = real;
		this.describe = describe;
	}

	@Override
	public Integer real() {
		return real;
	}

	@Override
	public String describe() {
		return describe;
	}

	public static PaymentOrderStatus realValueOf(Integer real) {
		if (Check.notNull(real)) {
			for (PaymentOrderStatus v : values()) {
				if (v.real().equals(real)) {
					return v;
				}
			}
		}
		return null;
	}
}
